/**
 * User: alesj
 * Date: 2005.3.15
 * Time: 17:50:03
 * 
 * (C) Genera Lynx d.o.o.
 */

package com.generalynx.common.data.dao;

import com.generalynx.common.data.IEntity;
import com.generalynx.common.userdata.IUser;
import org.springframework.dao.DataAccessException;

import java.util.List;

public interface IEntityDAO {

    public static final String entityDAO = "basicDAO";

    IEntity getEntity(Class clazz, int id) throws DataAccessException;
    IEntity loadEntity(Class clazz, int id) throws DataAccessException;
    void deleteEntity(IEntity entity) throws DataAccessException;
    void saveOrUpdateEntity(IEntity entity) throws DataAccessException;
    void saveOrUpdateEntity(IEntity[] entities) throws DataAccessException;
    List findEntity(String query) throws DataAccessException;
    List findEntity(String query, Object value) throws DataAccessException;
    List findEntity(String query, Object[] values) throws DataAccessException;
    List findEntity(Class entity) throws DataAccessException;
    List findEntityWithUser(Class entity, IUser user) throws DataAccessException;
    List findEntityByCreator(Class entity, IUser creator) throws DataAccessException;

}
